using MES_workbench.ErrorCode;
using WebApplication1.Implement.DTO;

namespace WebApplication1.Implement.IServices
{
    /// <summary>
    /// 智能客服服务接口
    /// </summary>
    public interface IChatService
    {
        /// <summary>
        /// 发送消息给AI客服
        /// </summary>
        /// <param name="request">聊天消息请求</param>
        /// <returns>AI回复</returns>
        Task<ApiResult<ChatMessageResponseDto>> SendMessageAsync(ChatMessageRequestDto request);

        /// <summary>
        /// 获取聊天历史记录
        /// </summary>
        /// <param name="sessionId">会话ID</param>
        /// <returns>聊天历史列表</returns>
        Task<ApiResult<List<ChatHistoryDto>>> GetChatHistoryAsync(string sessionId);

        /// <summary>
        /// 创建新的聊天会话
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>会话ID</returns>
        Task<ApiResult<string>> CreateChatSessionAsync(string? userId = null);

        /// <summary>
        /// 获取用户的所有聊天会话
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>会话列表</returns>
        Task<ApiResult<List<ChatHistoryDto>>> GetUserSessionsAsync(string? userId = null);
    }
}
